home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1985 November / Ahoy_Magazine_85-11_1985_Double_L.d64 / rhythm. bits (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  4KB  |  175 lines

  1. 40 poke 53280,1:poke53281,3
  2. 50 poke 650,255
  3. 100 gosub 2000
  4. 200 print"[147]"
  5. 210 print"             rhythmic bits"
  6. 220 print"            by david barron"
  7. 230 print"(f1) - define sounds"
  8. 240 print"(f3) - enter rhythmic pattern"
  9. 250 print"(f5) - change filter"
  10. 255 print"(f6) - set speed"
  11. 260 print"(f7) - play pattern"
  12. 270 print"    - enter your selection -"
  13. 280 get t$:if t$="" then 280
  14. 290 if t$="[133]" then 1000
  15. 295 if t$="[134]" then 5500
  16. 300 if t$="[135]" then 350
  17. 305 if t$="[139]" then 500
  18. 310 if t$="[136]" then 6000
  19. 320 goto 280
  20. 350 print "[147]            filter change"
  21. 352 print"(f1) - increase"
  22. 353 print"(f3) - decrease"
  23. 354 print"(f7) - quit"
  24. 360 print"low:                               :high"
  25. 380 print""
  26. 385 rem
  27. 390 print tab(5+fi/10);"  [146] [145]"
  28. 400 get t$:if t$="" then 400
  29. 410 if t$="[133]" then fi=fi+1:if fi>255 then fi=255
  30. 420 if t$="[134]" then fi=fi-1:if fi<0 then fi=0
  31. 425 if t$="[136]" then 440
  32. 430 goto 385
  33. 440 poke sid+22,fi
  34. 450 goto 200
  35. 500 print "[147]            speed change"
  36. 552 print"(f1) - decrease"
  37. 553 print"(f3) - increase"
  38. 554 print"(f7) - quit"
  39. 560 print"fast:                              :slow"
  40. 580 print""
  41. 585 rem
  42. 590 print tab(5+sp/10);"  [146] [145]"
  43. 600 get t$:if t$="" then 600
  44. 610 if t$="[133]" then sp=sp+1:if sp>254 then sp=254
  45. 620 if t$="[134]" then sp=sp-1:if sp<0 then sp=0
  46. 625 if t$="[136]" then 640
  47. 630 goto 585
  48. 640 poke 49164,sp+1
  49. 650 goto 200
  50. 1000 print"[147]":poke 650,255:if v>7 then v=0
  51. 1020 print""
  52. 1030 print"frequency:"
  53. 1040 print      "decay    :"
  54. 1050 print"wave type:"
  55. 1051 print "use (f1) for frequency increase"
  56. 1052 print "use (f2) for frequency decrease"
  57. 1053 print "use (f3) for attack increase"
  58. 1054 print "use (f4) for attack decrease"
  59. 1055 print "use (f5) to change waveform"
  60. 1056 print"use (f7) to change sound number"
  61. 1057 print"use (spacebar) to test sound"
  62. 1058 print"use (x) to exit"
  63. 1059 print"    sound definition for voice #";v
  64. 1060 print"";
  65. 1062 base=12*4096+256+v*4
  66. 1063 f=peek(base)+peek(base+1)*256
  67. 1064 d=peek(base+2):gosub 3000
  68. 1066 if d>15 then d=15
  69. 1067 if s>2 then s=2
  70. 1070 for x=1 to (f/65535)*28
  71. 1080 print " ";:next x:print"[146] ";
  72. 1090 print"":print"";
  73. 1100 for x=1 to d*1.7
  74. 1110 print " ";:next x:print"[146]  ";
  75. 1120 print"":print"";
  76. 1130 if s=0 then print"triangle":s1=16
  77. 1140 if s=1 then print"sawtooth":s1=32
  78. 1150 if s=2 then print"noise     ":s1=128
  79. 1160 get i$:if i$="" then 1160
  80. 1170 if i$="[133]"then f=f+(200^(1.25+f/650000)):if f>65535 then f=65535
  81. 1180 if i$="[137]"then f=f-(200^(1.25+f/650000)):if f<0 then f=0
  82. 1190 if i$="[134]"then d=d+1:if d>15then d=d-1
  83. 1200 if i$="[138]"then d=d-1:if d<0 then d=d+1
  84. 1210 if i$="[135]" then gosub 2200
  85. 1220 if i$="[136]"then v=v+1:if v>7 then v=0
  86. 1225 if i$="[136]"then goto 1000
  87. 1230 if i$=" " then poke sid+4,s1:pokesid+4,s1+1
  88. 1235 if i$="x" then 200
  89. 1240 poke sid,f-int(f/256)*256
  90. 1250 poke sid+1,int(f/256)
  91. 1260 poke sid+6,d+240
  92. 1270 poke sid+4,s1
  93. 1280 poke base,f-int(f/256)*256
  94. 1290 poke base+1,int(f/256)
  95. 1300 poke base+2,d:poke base+3,s1
  96. 1500 goto 1059
  97. 2000 rem initialize sid chip
  98. 2005 sid=54272:fi=128:sp=128
  99. 2010 for x=0 to 28
  100. 2020 poke sid+x,0:next x
  101. 2030 poke sid+21,7:poke sid+23,7:poke sid+22,fi
  102. 2040 poke sid+24,31
  103. 2050 return
  104. 2200 s=s+1:if s>2 then s=0
  105. 2205 if s=0 then s1=16
  106. 2210 if s=1 then s1=32
  107. 2220 if s=2 then s1=128
  108. 2230 return
  109. 3000 s1=peek(base+3)
  110. 3010 if s1=16 then s=0:return
  111. 3020 if s1=32 then s=1:return
  112. 3030 if s1=128 then s=2:return
  113. 3040 s1=16:s=0
  114. 3050 return
  115. 5000 data 1,2,1,4,1,2,1,4,1,2,1,4,1,2,1,4,1
  116. 5010 for x=49152+512 to 49152+512+16
  117. 5020 read a:poke x,a:next
  118. 5500 print "[147]             pattern entry"
  119. 5510 print"                 11111111112222222222333"
  120. 5520 print"[145]        12345678901234567890123456789012"
  121. 5525 print"[145][145]"
  122. 5530 for x=0  to 7
  123. 5550 print "voice";x;"[157]:"
  124. 5560 next x
  125. 5570 print "[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][145]"
  126. 5580 gosub 5850
  127. 5585 print"cursor keys move cursor"
  128. 5586 print"use (f7) to exit"
  129. 5587 print"spacebar toggles marker"
  130. 5588 print"use (f3) to clear pattern"
  131. 5600 v=0:x=0
  132. 5610 loc=40*7+v*40+8+x
  133. 5620 poke 1024+loc,peek(1024+loc)or128:poke55296+loc,14
  134. 5630 get a$:if a$="" then 5630
  135. 5640 if a$=" " then if peek(1024+loc)=86+128then poke 1024+loc,160:goto 5650
  136. 5645 if a$=" " then if peek(1024+loc)=160then poke 1024+loc,86+128
  137. 5650 if a$="" then x=x+1
  138. 5660 if a$="[157]" then x=x-1
  139. 5670 if a$="" then v=v+1
  140. 5675 if a$="[134]" then for x=49152+512 to 49152+512+32:poke x,0:next x:goto 5500
  141. 5680 if a$="[145]" then v=v-1
  142. 5685 if a$="[136]" then goto 5750
  143. 5690 poke 1024+loc,peek(1024+loc)and127
  144. 5700 if x<0 then x=0
  145. 5710 if x>31 then x=31
  146. 5720 if v<0 then v=0
  147. 5730 if v>7 then v=7
  148. 5740 goto 5610
  149. 5750 print"working.";
  150. 5752 for x=0 to 30
  151. 5755 s=0
  152. 5757 print".";
  153. 5760 for v=0 to 7
  154. 5770 loc=40*7+v*40+8+x
  155. 5780 if (peek(1024+loc)and127)=86 then s=s+2^v
  156. 5790 next v
  157. 5800 poke 49152+512+x,s
  158. 5810 next x
  159. 5815 gosub 8000
  160. 5820 goto 200
  161. 5850 for x=0 to 31
  162. 5860 for v=0 to 7
  163. 5862 if peek(49152+512+x)=0 then 5895
  164. 5865 if (peek(49152+512+x)and(2^v))=0 then 5890
  165. 5870 loc=40*7+v*40+8+x
  166. 5880 poke 1024+loc,86:poke 55296+loc,14
  167. 5890 next v
  168. 5895 next x:return
  169. 6000 sys 49312:if peek(197)=64 then 6000
  170. 6010 goto 200
  171. 8000 s=0:for v=0 to 7
  172. 8010 if (peek(40*7+v*40+39+1024)and127)=86 then s=s+2^v
  173. 8020 next v:poke 49152+512+31,s:return
  174. 9999 goto 9999
  175.